data = 0
    
# 打开文件进行读写
with open('a.out', 'r+b') as file:
    data = file.read()
    data = list(data)

    data = data[::-1]
    a = 0
# ---------
    for i in range(len(data)):
       data[i] ^= a
       a += 1
       if a == 100:
          a = 0
#    print(data)
# ---------

    data = bytes(data)

    file.seek(0)
    file.truncate()
    file.write(data)
